﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Net;
using System.IO;
using System.Xml.Serialization;
using System.Xml;

namespace Adams.Web.Controllers
{
    public class AnnouncementsController : Controller
    {
        [AppendLayoutModel]
        public ActionResult Index()
        {
            var model = Logic.Announcements.Index.PageLoad();
            return View(MobileCheck.IsMobile() ? "Index.Mobile" : "Index", model);
        }

        [AppendLayoutModel]
        public ActionResult Announcement(string titleorid)
        {
            titleorid = Shared.UrlHelper.Dec(titleorid);
            var model = Logic.Announcements.Announcement.PageLoad(titleorid);
            if (model.Announcement == null)
            {
                return HttpNotFound();
            }
            else
            {
                return View(MobileCheck.IsMobile() ? "Announcement.Mobile" : "Announcement", model);
            }
        }
    }
}
